//
//  SHRuntimeViewController.m
//  SDemo
//
//  Created by gg on 2018/7/17.
//  Copyright © 2018年 gg. All rights reserved.
//

#import "SHRuntimeViewController.h"
#import <objc/message.h>
#import "SHPerson.h"
#import "NSObject+Property.h"

@interface SHRuntimeViewController ()

@end

@implementation SHRuntimeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"运行时";
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self initData];
}


- (void)initData {
    SHPerson *person =  [[SHPerson alloc] init];
    person.name = @"json";
    person.age = @"12";
    NSLog(@"age : %@, name : %@",person.age, person.name);
    
    
    /**
     runtime 常见作用:
     
     动态交换两个方法的实现
     动态添加属性
     实现字典转模型的自动转换
     发送消息
     动态添加方法
     拦截并替换方法
     实现 NSCoding 的自动归档和解档
     
     */
    
    
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}



@end



